import SimpleITK as sitk
readRes=sitk.ReadTransform('LungTrans4m.txt')
print(readRes)
# exit(0)
moving=sitk.ReadImage('Masked/'+str(9)+'masked.nii',sitk.sitkFloat32)
output=sitk.Resample(moving,readRes,sitk.sitkLinear,0,sitk.sitkInt16)
sitk.WriteImage(output,'9linear0.nii')

# outP=outTx.TransformPoint([100,120,30])
# TransformDomainOrigin: [-0.625, -0.625, -0.625]
# TransformDomainPhysicalDimensions: [335.25, 343.25, 54.25]    imgSz:[335,343,54]
# print(outP)